package com.jxx.mybatisplus.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author Jxx
 * @create 2021-08-01 15:07
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    //AUTO自增，数据库中设计也应该是自增的
    //NONE 未设置主键
    //INPUT 手动输入，要自己输入id
    //ID_WORKER 默认的全局唯一id
    //UUID 全局唯一ID
    //ID_WORKER_STR 字符串表示法
    @TableId(type = IdType.AUTO)
    private Long id;
    private Integer age;
    private String name;
    private String email;
    // 自动填充
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    @Version
    private Integer version;//乐观锁
    @TableLogic
    private Integer deleted;//逻辑删除
}
